package com.bonc.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonc.modules.item.dao.ItemChartDao;
import com.bonc.modules.item.entity.ItemChartEntity;
import com.bonc.modules.item.param.ItemChartParam;
import com.bonc.modules.item.service.ItemChartService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author jinlong
 * @date 2021/7/27
 */
@Service
public class ItemChartServiceImpl extends ServiceImpl<ItemChartDao, ItemChartEntity> implements ItemChartService {


    @Override
    public List<ItemChartEntity> getChartList(ItemChartParam itemChartParam) {
        LambdaQueryWrapper<ItemChartEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ItemChartEntity::getItemCode, itemChartParam.getItemCode());
//        queryWrapper.eq(ItemChartEntity::getDimId, itemChartParam.getDimId());
//        queryWrapper.eq(ItemChartEntity::getGroupCode, itemChartParam.getGroupCode());
        queryWrapper.orderByAsc(ItemChartEntity::getOrderNum);
        return this.baseMapper.selectList(queryWrapper);
    }
}
